using namespace std;
#include <iostream>
#include <cmath>

typedef unsigned int u32;
typedef unsigned long long u64;
int main()
{
	u64 target=600851475143LLU;
	u32 current=u32(target/2), check;
	
	while(current > 0)
	{
		bool prime = true;
		if(target % current == 0)
		{
			for(u32 i=2; i <= sqrt(current); i++)
			{
				if(current % i == 0)
				{
					prime=false;
					break;
				}
			}
			if (prime)
			{
				cout << "Answer is : " << current << endl;
					return 0;
			}
		}
		current--;
	}
}
